<template>
  <div class="wwrap">
    <router-view></router-view>
    <!-- <div> -->
      <van-tabbar v-model="active" active-color="rgb(255,96,64)">
        <van-tabbar-item icon="home-o" @click="$router.push('/index/home')">首页</van-tabbar-item>
        <van-tabbar-item icon="apps-o" @click="$router.push('/index/sort')">分类</van-tabbar-item>
        <van-tabbar-item icon="shopping-cart-o" @click="$router.push('/index/cart')">购物车</van-tabbar-item>
        <van-tabbar-item icon="contact" @click="$router.push('/index/mine')">我的</van-tabbar-item>
      </van-tabbar>
    <!-- </div> -->
  </div>
</template>
<script>
  export default {
    //组件内部路由守卫
    // beforeRouteEnter(to,from,next){
    //   //只能通过login页面进入首页
    //   if(from.path=="/login" && sessionStorage.getItem("person")){
    //     next()
    //   }
    // },
    data() {
      return {
        active:0
      }
    },
    methods: {},
    components: {},
    mounted() {

    },
    
  }
</script>
<style scoped>
.wwrap{
  position: relative;
      height: 100vh;
}
.van-tabbar--fixed{
  position: absolute;
  left: 0;
  bottom: 0;
}

</style>